<template>
  <div class="meetingManage">
    <MyNavBar @goback="goback" title="会议管理" />
    <div class="meeting_con" v-if="pageShow">
      <van-tabs
        @click="tabsClick"
        class="cont-tab"
        v-model="tabsActive"
        :sticky="true"
        line-width="35"
        line-height="2"
        swipeable>
        <van-tab v-for="tab in tabsList" :key="tab.id" :title="tab.name" :name="tab.id"></van-tab>
      </van-tabs>
      <div class="con_box">
        <MeetingList v-if="tabsActive === '0'"></MeetingList>
        <MeetingSelf v-if="tabsActive === '1'"></MeetingSelf>
      </div>
    </div>
  </div>
</template>

<script>
import MeetingSelf from './components/MeetingSelf'
import MeetingList from './components/MeetingList'
export default {
  name: 'indexMeet',
  components: { MeetingSelf, MeetingList },
  props: {},
  data() {
    return {
      tabsActive: '0',
      tabsList: [
        { name: '会议列表', id: '0' },
        { name: '我的会议', id: '1' },
      ],
      pageShow: false,
      userInfo: JSON.parse(localStorage.userInfo),
    }
  },
  watch: {},
  computed: {},
  created() {
    const routeLength = this.$route.path.length
    if (this.$store.state.pageTab.substring(0, routeLength) === this.$route.path) {
      this.tabsActive = this.$store.state.pageTab.substring(this.$route.path.length)
    }
    this.pageShow = true
  },
  mounted() {},
  methods: {
    tabsClick(data) {
      this.$store.state.pageTabTwo = ''
      this.tabsActive = data
      this.$store.state.pageTab = this.$route.path + this.tabsActive
    },
    goback() {
      this.$store.state.pageTab = ''
      this.$router.go(-1)
    },
  },
}
</script>
<style lang="scss" scoped>
.meetingManage {
  padding-top: 48px;
  height: 100%;
  position: relative;
  background-size: 100% 100%;
  font-size: 14px;
  .meeting_con {
    height: 100%;
    .cont-tab {
      /deep/.van-tabs__wrap {
        height: 36px;
        background: #fff;
        // margin-bottom: 10px;
        border-bottom: 1px solid #efefef;
        .van-tab__text {
          line-height: 36px;
          font-size: 14px;
        }
        .van-tabs__nav {
          width: 100%;
        }
      }
    }
    /deep/.con_box {
      height: calc(100% - 1rem);
      .right0,
      .right4 {
        color: #909399;
      }
      .right1 {
        color: #f56c6c;
      }
      .right2 {
        color: #ee792f;
      }
      .right3 {
        color: #67c23a;
      }
      .right5 {
        color: #409eff;
      }
    }
  }
}
</style>
